home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / C_LOC.PRG < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.7 KB  |  61 lines

  1. //*****************************************************************************
  2. // C_Loc.prg
  3. // Location class for OBJECT v2.03
  4. // Copyright (c) 1991, JHK, JHK-Software, Piestany
  5. // Please compile with: /N/M/W/A
  6. //-----------------------------------------------------------------------------
  7.  
  8. #include "Object.ch"
  9.  
  10. create class Loc
  11.   export:
  12.   var Row     // 3
  13.   var Col     // 4
  14.   method New=LocNew              //o:New()
  15.   method Init=LocInit            //o:Init(Row,Col)  //save parameters into instvar vars
  16.   method Get=LocGet              //o:Get()          //save location
  17.   method Set=LocSet              //o:Set()          //restore location
  18.   endclass
  19.  
  20.  
  21. //*****************************************************************************
  22. // Loc:New() --> self
  23. // initialize new object
  24. //
  25. constructor LocNew()
  26.   ::Row:= 3
  27.   ::Col:= 4
  28.   return(self)
  29.  
  30.  
  31. //*****************************************************************************
  32. // Loc:Init(Row,Col) --> true
  33. // initialize location
  34. //
  35. method function LocInit(Row,Col)
  36.   store value Row into ::Row
  37.   store value Col into ::Col
  38.   return(true)
  39.  
  40.  
  41. //*****************************************************************************
  42. // Loc:Get() --> true
  43. // get current location from hw and save it
  44. //
  45. method function LocGet()
  46.   ::Row:=Row()          //save row
  47.   ::Col:=Col()          //save col
  48.   return(true)
  49.  
  50.  
  51. //*****************************************************************************
  52. // Loc:Set() --> true
  53. // Set current location into hw
  54. //
  55. method function LocSet()
  56.   SetPos(::Row,::Col) //restore location
  57.   return(true)
  58.  
  59. //------------------------------------------------------- eof (c)JHK ----------
  60.  
  61.